﻿using System;
using System.Web.Services;
using ZX.BLL;
using System.Configuration;
using ZX.DAL.DBExtend;

namespace ZX.WebApp.EHR
{
    /// <summary>
    /// SalaryWebService 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消对下行的注释。
    // [System.Web.Script.Services.ScriptService]
    public class SalaryWebService : System.Web.Services.WebService
    {
        /// <summary>
        /// 计算员工薪资,后台自动运行
        /// </summary>
        /// <returns></returns>
        [WebMethod]
        public void CalEmployeeSalary()
        {
           SalaryFormulaResolve.CalEmployeeSalarySQL();
        }

        /// <summary>
        /// 供客户端调用,计算工资
        /// </summary>
        /// <param name="yearMonth"></param>
        [WebMethod]
        public void CalClientEmployeeSalary(string yearMonth)
        {
            SalaryFormulaResolve.CalClientEmployeeSalarySQL(yearMonth);
        }

        /// <summary>
        /// 单独计算某个人的薪资
        /// </summary>
        /// <param name="emp"></param>
        /// <param name="yearMonth"></param>
        [WebMethod]
        public void CalSingleEmployeeSalary(string empId,string yearMonth)
        {
            SalaryFormulaResolve.CalSingleEmployeeSalarySQL(empId, yearMonth);
        }
    }
}
